﻿@using Nop.Web.Framework
@using Nop.Services.Localization
@using System.Web.Mvc
@using System.Globalization
@using Nop.Core.Domain.Media

@model IList<Nop.Web.Models.Media.SlideshowModel>

@foreach (var s in Model)
{
    var index = 0;
    if (s.Type == SlideshowType.Carousel && s.PictureLinks.Count > 0)
    {
        foreach (var picture in s.PictureLinks)
        {
            var url = picture.Url;
            //if (index == 0) {
            //    url = Url.RouteUrl("Topic", new { SystemName = "WelcomeToSpotsHUB" });
            //}
            //if (index == 1)
            //{
            //    url = "/la-ferrari-114-red";
            //}
            //if (index == 2)
            //{
            //    url = "/happy-grand-piano-black";
            //}
            <div class="item @(index==0?"active":"") home-slide">
                <a href="@url">
                    <img alt="@picture.AlternateText" src="@picture.FullSizeImageUrl" />
                </a>
            </div>
            index++;
        }
    }
    else if (s.Type != SlideshowType.None)
    {
        <b>The slideshow type is not implemented @((int)s.Type).</b>
    }

}

